package com.java.comprehensive.arithmetic.programmers;

/**
 * @program: comprehensive-service
 *
 * @description: URL 化
 *
 * @author: 窦绍飞
 *
 * @create: 2022-01-20 11:29
 **/
public class URLization {
	public static String replaceSpaces(String s, int length) {

		return s.substring(0,length).replace(" ","%20");
	}

	public static void main(String[] args) {
		String s = "Mr John Smith    ";
		int length = 13;
		String s1 = replaceSpaces(s, length);
		System.out.println(s1);
	}
}
